﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using MN.Framework.Extensions;
using MN.Framework.Common;
using System.Linq;

namespace MN.Framework.UI.Win.Forms
{
    public partial class SchedulerForm : Telerik.WinControls.UI.RadForm
    {
        BaseContext context { get; set; }
        public SchedulerForm(BaseContext context)
        {
            this.context = context;
            InitializeComponent();
            radScheduler1.Appointments.CollectionChanged += Appointments_CollectionChanged;
            radScheduler1.Resources.CollectionChanged += Resources_CollectionChanged;
            ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Dark";
        }

        void Resources_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            resourcesTableAdapter.Update(this.databasePezeshkiDataSet.Resources);
            this.databasePezeshkiDataSet.AcceptChanges();
        }

        void Appointments_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            appointmentsTableAdapter.Update(this.databasePezeshkiDataSet.Appointments);
            this.databasePezeshkiDataSet.AcceptChanges();
        }

        private void BtnLogin_Click(object sender, EventArgs e)
        {

        }

        private void radScheduler1_AppointmentAdded(object sender, Telerik.WinControls.UI.AppointmentAddedEventArgs e)
        {

        }

        private void RadForm1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'databasePezeshkiDataSet.Resources' table. You can move, or remove it, as needed.
            this.resourcesTableAdapter.Fill(this.databasePezeshkiDataSet.Resources);
            // TODO: This line of code loads data into the 'databasePezeshkiDataSet.Appointments' table. You can move, or remove it, as needed.
            this.appointmentsTableAdapter.Fill(this.databasePezeshkiDataSet.Appointments);

        }

        private void databasePezeshkiDataSetBindingSource_CurrentChanged(object sender, EventArgs e)
        {

        }
    }
}
